﻿using Ross.OA.Utility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Ross.OA.Client
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            bool createdNew;
            using (Mutex mutex = new Mutex(true, "Ross.OA.Client_Mutex", out createdNew))
            {
                if (!createdNew)
                {
                    MessageBox.Show("程序已在运行中，不能重复打开！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                AutoMapper.Configuration.Configure();

                //FileHelper.CreateFile(Application.StartupPath + "\\log.txt");
                FileHelper.CreateFile(Application.StartupPath + "\\localcfg.json");
                log4net.Config.XmlConfigurator.Configure();

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new FormMain());
            }
            
        }
    }
}
